﻿/* Created by Richard Fleming
 * Copyright 2009 Johnson County Community College
 * Free for non-commercial use
 */

using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace XnaUtility.GameObjects
{
    public class ObjectManager2D : DrawableGameComponent
    {

        List<Base2DObject> objects;
        int maxObjects = 1000;
        SpriteBatch spriteBatch;


        public ObjectManager2D(Game game)
            : base(game)
        {
            objects = new List<Base2DObject>();
        }

        public override void Update(GameTime gameTime)
        {

            foreach (Base2DObject obj in objects)
            {
                if(obj.Alive) obj.Update(gameTime);
            }

            base.Update(gameTime);
        }

        public override void Draw(GameTime gameTime)
        {
            

            base.Draw(gameTime);
        }
    }
}
